package com.itlong.cloud.property.resource;

import com.alibaba.fastjson.JSONObject;
import com.itlong.cloud.POJO.DTO.property.*;
import com.itlong.cloud.POJO.DTO.sdk.CloudFaceApiDTO;
import com.itlong.cloud.POJO.DTO.smartcard.SmartCardUserUpdateDTO;
import com.itlong.cloud.POJO.PO.AppUserProjectPO;
import com.itlong.cloud.POJO.PO.AppUserRoomPO;
import com.itlong.cloud.POJO.VO.jd.JDResultVO;
import com.itlong.cloud.POJO.VO.property.AppUserInfoGetVO;
import com.itlong.cloud.POJO.VO.property.CheckHouseHoldByRoomVO;
import com.itlong.cloud.POJO.VO.property.PropertyUserProofAuthInfoGetVO;
import com.itlong.cloud.POJO.VO.sdk.SDKFaceUserInfoGetVO;
import com.itlong.cloud.property.service.IPropertyHouseHoldInfoService;
import com.itlong.cloud.user.property.IPropertyHouseHoldInfoServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      用户信息服务暴露接口实现类。
 * </desc>
 * @createDate 2017/09/18
 */
@RestController
public class PropertyHouseHoldInfoServiceResource implements IPropertyHouseHoldInfoServiceClient {

    private static final Logger LOG = LoggerFactory.getLogger(PropertyHouseHoldInfoServiceResource.class);

    @Autowired
    IPropertyHouseHoldInfoService iPropertyHouseHoldInfoService;

    /**
     * <desc>
     *      检测用户是否是项目中
     * </desc>
     *
     * @param phoneNum
     * @param projectId
     * @param roomId
     * @return
     * @author Jiaqi.X
     * @createDate 2020/03/19
     */
    @RequestMapping(path = "/manage/checkUserInProject", method = RequestMethod.POST)
    public Map<String, Object> checkUserInProject(@RequestParam("phoneNum") String phoneNum,@RequestParam("projectId") String projectId,
                                                  @RequestParam("roomId") String roomId){
        return iPropertyHouseHoldInfoService.checkUserInProject(phoneNum,projectId,roomId);
    }

    /**
     * <desc>
     *      获取地址下的楼栋信息
     * </desc>
     *
     * @param address
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2020/03/18
     */
    @RequestMapping(path = "/manage/getRoomInfoByBuildNameAndUnitNameAndRoomNum", method = RequestMethod.POST)
    @Override
    public Map<String,Object> getRoomInfoByBuildNameAndUnitNameAndRoomNum(@RequestParam("address") String address,@RequestParam("projectId") String projectId){
        return iPropertyHouseHoldInfoService.getRoomInfoByBuildNameAndUnitNameAndRoomNum(address,projectId);
    }

    /**
     * <desc>
     *      添加App用户信息前判断用户是否存在
     * <desc/>
     *
     * @param projectId  项目Id
     * @param phoneNum  App用户手机号
     * @return Integer
     * @author zhangs
     * @createDate 2017/09/26
     */
    @Override
    @RequestMapping(path = "/manage/getAppUserExistStatus")
    public Integer getAppUserExistStatus(@RequestParam("projectId") String projectId, @RequestParam("phoneNum") String phoneNum) {
        return iPropertyHouseHoldInfoService.getUserByPhoneNum(projectId, phoneNum);
    }


    /**
     * <desc>
     *      保存用户信息接口服务
     * <desc/>
     * @param appUserGetUserInfoDTO App用户信息数据传输对象
     * @param isSmartCommunity 是否开启云对讲
     * @param loginUserId 物业登录账号
     * @return
     * @author zhangs
     * @createDate 2017/09/19
     */
    @Override
    @RequestMapping(path = "/manage/addAppUser")
    public void addAppUser(
            @RequestBody AppUserGetUserInfoDTO appUserGetUserInfoDTO,
            @RequestParam("isSmartCommunity") Integer isSmartCommunity,
            @RequestParam("loginUserId") String loginUserId) throws Exception{
        iPropertyHouseHoldInfoService.saveUser(appUserGetUserInfoDTO, isSmartCommunity, loginUserId);
    }

    /**
     * <desc>
     *      修改App用户信息接口
     * <desc/>
     *
     * @param appUserGetUserInfoDTO  App用户信息数据传输对象
     * @param loginUserId  物业登录账号
     * @param isSmartCommunity  是否使用云对讲： 0-否，1-是
     * @return List<String> 住户Id集
     * @author zhangs
     * @createDate 2017/09/26
     */
    @Override
    @RequestMapping(path = "/manage/updateAppUser")
    public List<String> updateAppUser(
            @RequestBody AppUserGetUserInfoDTO appUserGetUserInfoDTO,
            @RequestParam(value = "loginUserId",required = false) String loginUserId,
            @RequestParam("isSmartCommunity") Integer isSmartCommunity) throws Exception {
        return iPropertyHouseHoldInfoService.updateAppUser(appUserGetUserInfoDTO, loginUserId, isSmartCommunity);
    }

    /**
     * <desc>
     *      查询App用户信息接口(已入住+查询按钮)
     * <desc/>
     * @param checkAppUserDTO 查询App用户信息数据传输对象
     * @return Page<CheckAppUserInfoDTO> App用户房间信息分页集
     * @author zhangs
     * @createDate 2017/09/19
     */
    @Override
    @RequestMapping(path = "/manage/getCheckUserList")
    public Page<AppUserInfoGetVO> getCheckUserList(@RequestBody CheckAppUserDTO checkAppUserDTO) throws Exception {
        return iPropertyHouseHoldInfoService.getUserList(checkAppUserDTO);
    }

    /**
     * <desc>
     *      住户权限分配查询App用户信息接口
     * <desc/>
     * @param checkAppUserDTO 查询App用户信息数据传输对象
     * @return Page<CheckAppUserInfoDTO> App用户房间信息分页集
     * @author Qiang.S
     * @createDate 2020/02/21
     */
    @Override
    @RequestMapping(path = "/manage/getCheckUserListForHouseHold")
    public Page<AppUserInfoGetVO> getCheckUserListForHouseHold(@RequestBody CheckAppUserDTO checkAppUserDTO) throws Exception {
        return iPropertyHouseHoldInfoService.getCheckUserListForHouseHold(checkAppUserDTO);
    }

    /**
     * <desc>
     *      修改App用户信息时获取App用户信息
     * <desc/>
     * @RequestBody appUserGetOneDTO 获取单个App用户信息的数据传输对象
     * @return AppUserGetUserDetailsInfoDTO App用户信息更新时获取信息数据传输对象
     * @author zhangs
     * @createDate 2017/09/25
     */
    @Override
    @RequestMapping(path = "manage/updateUserGet")
    public AppUserUpdateUserGetDTO updateUserGet(@RequestBody AppUserGetOneDTO appUserGetOneDTO){
        return iPropertyHouseHoldInfoService.updateUserGet(appUserGetOneDTO);
    }

    /**
     * <desc>
     *      查看App用户信息接口(已入住的查看按钮)
     * <desc/>
     *
     * @param appUserGetOneDTO 获取单个App用户信息的数据传输对象
     * @return HouseHoldDetailsInfoDTO 物业住户信息详情页住户详情数据传输对象
     * @author zhangs
     * @createDate 2017/09/20
     */
    @RequestMapping(path = "/manage/getUserInfo", method = RequestMethod.POST)
    @Override
    public HouseHoldDetailsInfoDTO getUserInfo(@RequestBody AppUserGetOneDTO appUserGetOneDTO) throws Exception{
        return iPropertyHouseHoldInfoService.getUserById(appUserGetOneDTO);
    }

    /**
     * <desc>
     *      迁出App用户接口(单个和批量)
     * <desc/>
     *
     * @param appUserUpdateUserRoomStatusDTO App用户房间状态信息数据传输对象
     * @param isSmartCommunity 是否使用云对讲： 0-否，1-是
     * @param authUserId 授权人Id
     * @param sceneType 推送场景类型(HouseHoldJPushSceneTypeEnum)
     * @return List<String> 住户Id集
     * @author zhangs
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/manage/userRemove")
    @Override
    public List<String> userRemove(
            @RequestBody AppUserUpdateUserRoomStatusDTO appUserUpdateUserRoomStatusDTO,
            @RequestParam("isSmartCommunity") Integer isSmartCommunity,
            @RequestParam("authUserId") String authUserId,
            @RequestParam("sceneType") String sceneType) throws Exception{
        return iPropertyHouseHoldInfoService.userRemove(appUserUpdateUserRoomStatusDTO, isSmartCommunity, authUserId, sceneType);
    }

    /**
     * <desc>
     *      迁入App用户接口
     * <desc/>
     *
     * @param appUserUpdateUserRoomStatusDTO 迁入App用户信息数据传输对象的List
     * @param isSmartCommunity 是否使用云对讲： 0-否，1-是
     * @param authUserId 授权人Id
     * @param sceneType 推送场景类型(HouseHoldJPushSceneTypeEnum)
     * @return 住户Id集
     * @author zhangs
     * @createDate 2017/09/26
     */
    @RequestMapping(path = "/manage/userMoveIn")
    @Override
    public List<String> userMoveIn(
            @RequestBody AppUserUpdateUserRoomStatusDTO appUserUpdateUserRoomStatusDTO,
            @RequestParam("isSmartCommunity") Integer isSmartCommunity,
            @RequestParam("authUserId") String authUserId,
            @RequestParam("sceneType") String sceneType) throws Exception{
        return iPropertyHouseHoldInfoService.userRemove(appUserUpdateUserRoomStatusDTO, isSmartCommunity, authUserId, sceneType);
    }

    /**
     * <desc>
     *      审核用户接口
     * <desc/>
     *
     * @param examineHouseHoldDTO 审核住户数据传输对象
     * @param isSmartCommunity 是否使用云对讲： 0-否，1-是
     * @param projectId 项目Id
     * @param authUserId 授权人Id
     * @param sceneType 推送场景类型(HouseHoldJPushSceneTypeEnum)
     * @return
     * @author zhangs
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/manage/examineUser", method = RequestMethod.POST)
    @Override
    public void examineUser(
            @RequestBody ExamineHouseHoldDTO examineHouseHoldDTO,
            @RequestParam("isSmartCommunity") Integer isSmartCommunity,
            @RequestParam("projectId") String projectId,
            @RequestParam("authUserId") String authUserId,
            @RequestParam("sceneType") String sceneType) throws Exception {
        iPropertyHouseHoldInfoService.examineUser(examineHouseHoldDTO, isSmartCommunity, projectId, authUserId, sceneType);
    }

    /**
     * <desc>
     *      冻结/解冻App用户状态接口
     * <desc/>
     *
     * @param appUserUpdateUserProjectStatusDTO 更新App用户项目状态数据传输对象
     * @return 被影响的数据数量
     * @author zhangs
     * @createDate 2017/09/29
     */
    @RequestMapping(path = "/manage/userProjectStatus")
    @Override
    public Integer userProjectStatus(@RequestBody AppUserUpdateUserProjectStatusDTO appUserUpdateUserProjectStatusDTO) throws Exception {
        return iPropertyHouseHoldInfoService.userProjectStatus(appUserUpdateUserProjectStatusDTO);
    }

    /**
     * <desc>
     *      删除用户房间关系(住户信息-未通过-删除)
     * <desc/>
     *
     * @param appUserDelUserRoomDTOS App用户房间信息数据传输对象集
     * @return Integer 被影响数据数量
     * @author zhangs
     * @createDate 2017/09/30
     */
    @RequestMapping(path = "manage/delUserRoom")
    @Override
    public Integer delUserRoom(
            @RequestBody List<AppUserDelUserRoomDTO> appUserDelUserRoomDTOS,
            @RequestParam("projectId") String projectId) throws Exception {
        return iPropertyHouseHoldInfoService.delUserRoom(appUserDelUserRoomDTOS, projectId);
    }

    /**
     * <desc>
     *      判断房间下是否已有业主
     * <desc/>
     *
     * @param appUserRoomOwnerIsExistDTO 房间中是否存在业主状态的数据传输对象
     * @return List<AppUserRoomPO> 住户房间信息
     * @author zhangs
     * @createDate 2017/10/10
     */
    @RequestMapping(path = "manage/getExistHouserByRoom")
    @Override
    public List<AppUserRoomPO> getExistHouserByRoom(@RequestBody AppUserRoomOwnerIsExistDTO appUserRoomOwnerIsExistDTO) {
        return iPropertyHouseHoldInfoService.getExistHouserByRoom(appUserRoomOwnerIsExistDTO);
    }

    /**
     * <desc>
     *      获取与用户绑定的地址
     * <desc/>
     *
     * @param appUserGetNotContactRoomDTO 未与用户绑定的地址信息数据传输对象
     * @return List<AppUserGetContractRoomDTO> 用户房间信息集
     * @author zhangs
     * @createDate 2017/10/20
     */
    @RequestMapping(path = "manage/getRoomNotContactHouser")
    @Override
    public List<AppUserGetContractRoomDTO> getRoomContactHouser(@RequestBody AppUserGetNotContactRoomDTO appUserGetNotContactRoomDTO) {
        return iPropertyHouseHoldInfoService.getRoomContactHouser(appUserGetNotContactRoomDTO);
    }

    /**
     * <desc>
     *      根据设备服务地址查询地址下住户现有权限地址
     * <desc/>
     *
     * @param params 楼栋列表或单元列表
     * @return List<UserDeviceAuthAddreddDTO> 住户现有权限地址集
     * @author zhangs
     * @createDate 2017/10/20
     */
    @RequestMapping(path = "manage/getAuthAddrByDeviceAddr", method = RequestMethod.POST)
    @Override
    public List<UserDeviceAuthAddreddDTO> getAuthAddrByDeviceAddr(@RequestBody Map<String, String> params) throws Exception{
        return iPropertyHouseHoldInfoService.getAuthAddrByDeviceAddr(params);
    }

    /**
     * <desc>
     *      根据地址查询住户
     * <desc/>
     *
     * @param params 楼栋列表或单元列表
     * @return
     * @author zhangs
     * @createDate 2017/10/20
     */
    @RequestMapping(path = "manage/getUserByAddr", method = RequestMethod.POST)
    @Override
    public List<Map<String, Object>> getUserByAddr(@RequestBody Map<String, List<String>> params) throws Exception {
        return iPropertyHouseHoldInfoService.getUserByAddr(params);
    }

    /**
     * <desc>
     *      查询住户的手机号
     * <desc/>
     *
     * @param userId 住户ID
     * @return
     * @author zhangs
     * @createDate 2017/10/20
     */
    @RequestMapping(path = "manage/getUserPhone", method = RequestMethod.POST)
    @Override
    public String getUserPhone(@RequestParam("userId") String userId) {
        return iPropertyHouseHoldInfoService.getUserPhone(userId);
    }

    /**
     * <desc>
     *      获取与用户绑定的楼栋下房间地址数量
     * <desc/>
     *
     * @param userId 住户Id
     * @param projectId 项目Id
     * @return Map<String, Integer> 楼栋Id与其对应住户房间数量的Map集，
     *      Map<buildId, roomCount>:楼栋Id，楼栋下住户绑定的房间数量
     * @author zhangs
     * @createDate 2017/11/10
     */
    @RequestMapping(path = "manage/getBuildNotContactHouse", method = RequestMethod.POST)
    @Override
    public Map<String, Integer> getBuildNotContactHouse(
            @RequestParam("userId") String userId, @RequestParam("projectId") String projectId) {
        return iPropertyHouseHoldInfoService.getBuildNotContactHouse(userId, projectId);
    }

    /**
     * <desc>
     *      获取与用户绑定的单元下房间地址数量
     * <desc/>
     *
     * @param userId 住户Id
     * @param projectId 项目Id
     * @param buildId 楼栋Id
     * @return Map<String, Integer> 单元Id与其对应住户房间数量的Map集，
     *      Map<unitId, roomCount>:单元Id，单元下住户绑定的房间数量
     * @author zhangs
     * @createDate 2017/11/10
     */
    @RequestMapping(path = "manage/getUnitNotContactHouse", method = RequestMethod.POST)
    @Override
    public Map<String, Integer> getUnitNotContactHouse(
            @RequestParam("userId") String userId,
            @RequestParam("projectId") String projectId,
            @RequestParam("buildId") String buildId) {
        return iPropertyHouseHoldInfoService.getUnitNotContactHouse(userId, projectId, buildId);
    }

    /**
     * <desc>
     *      根据房间id查询住户列表
     * <desc/>
     *
     * @param roomId 房间id
     * @return Key值(userId,userName,qqNum,sipAccount,isAllowApp,isOnline,projectId)
     * @author Chunjian.G
     * @createDate 2017-11-16
     */
    @RequestMapping(path = "manage/getUserByRoomId",method = {RequestMethod.POST})
    @Override
    public List<Map<String, Object>> getUserByRoomId(@RequestParam("roomId") String roomId) throws Exception {
        return iPropertyHouseHoldInfoService.getUserByRoomId(roomId);
    }

    /**
     * <desc>
     *      根据住户项目关系PO查询住户项目关系PO
     * <desc/>
     *
     * @param appUserProjectPO 住户项目关系PO
     * @return AppUserProjectPO 住户项目关系PO
     * @author zhangs
     * @createDate 2017-11-16
     */
    @RequestMapping(path = "manage/getUserProject",method = {RequestMethod.POST})
    @Override
    public AppUserProjectPO getUserProject(@RequestBody AppUserProjectPO appUserProjectPO) throws Exception {
        return iPropertyHouseHoldInfoService.getUserProject(appUserProjectPO);
    }


    /**
     * <desc>
     *      房屋管理-房屋详情-入住迁出记录
     * <desc/>
     *
     * @param checkHouseHoldByRoomDTO 房屋详情中查询入住迁出记录条件数据传输对象
     * @return List<CheckHouseHoldByRoomVO> 房屋详情中查询入住迁出记录数据信息
     * @author zhangs
     * @createDate 2017/11/23
     */
    @RequestMapping(path = "/manage/moveInAndOutRecord", method = RequestMethod.POST)
    @Override
    public List<CheckHouseHoldByRoomVO> moveInAndOutRecord(@RequestBody CheckHouseHoldByRoomDTO checkHouseHoldByRoomDTO) throws Exception {
        return iPropertyHouseHoldInfoService.moveInAndOutRecord(checkHouseHoldByRoomDTO);
    }

    /**
     * <desc>
     *      获取小区中所有住户项目信息
     * </desc>
     * @param projectId 项目Id
     * @return Integer 住户数量
     * @author zhangs
     * @createDate 2017/11/25
     */
    @RequestMapping(path = "/manage/getAllHouseProjectInfo", method = RequestMethod.POST)
    @Override
    public Integer getAllHouseProjectInfo(@RequestParam("projectId") String projectId) throws Exception {
        return iPropertyHouseHoldInfoService.getAllHouseProjectInfo(projectId);
    }

    /**
     * <desc>
     *      获取住户最新地址
     * </desc>
     * @param projectId 项目Id
     * @param userIds 住户Id集
     * @return List<AppUserProjectPO> 住户项目信息集
     * @author zhangs
     * @createDate 2017/11/25
     */
    @RequestMapping(path = "/manage/getHouseHoldRoom", method = RequestMethod.POST)
    @Override
    public List<AppUserRoomPO> getHouseHoldRoom(@RequestParam("projectId") String projectId, @RequestBody List<String> userIds) throws Exception {
        return iPropertyHouseHoldInfoService.getHouseHoldRoom(projectId, userIds);
    }

    /**
     * <desc>
     *      获取住户所在楼栋Id并以逗号拼接
     * <desc/>
     *
     * @param userId App用户Id
     * @param  projectId  项目Id
     * @return 住户所在楼栋Id并以逗号拼接
     * @author zhangs
     * @createDate 2017/11/23
     */
    @RequestMapping(path = "/manage/getBuildIdsByHouseHold", method = RequestMethod.POST)
    @Override
    public String getBuildIdsByHouseHold(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception {
        return iPropertyHouseHoldInfoService.getBuildIdsByHouseHold(userId, projectId);
    }

    /**
     * <desc>
     *      获取住户所在楼栋Id并以逗号拼接
     * <desc/>
     *
     * @param userId App用户Id
     * @param  projectId  项目Id
     * @return 住户所在楼栋
     * @author zhangs
     * @createDate 2017/11/23
     */
    @Override
    @RequestMapping(path = "/manage/getUserBuilds", method = RequestMethod.POST)
    public List<Map<String,Object>> getUserBuilds(@RequestParam("userId") String userId,
                                                  @RequestParam("projectId") String projectId) throws Exception{
        return iPropertyHouseHoldInfoService.getUserBuilds(userId,projectId);
    }

    /**
     * <desc>
     *      获取房间中正常状态住户的数量
     * <desc/>
     *
     * @param roomId 房间Id
     * @param  projectId  项目Id
     * @return 房间中正常状态住户的数量
     * @author zhangs
     * @createDate 2017/12/04
     */
    @RequestMapping(path = "/manage/getMoveInHouseHoldCount", method = RequestMethod.POST)
    @Override
    public Integer getMoveInHouseHoldCount(@RequestParam("roomId") String roomId, @RequestParam("projectId") String projectId) throws Exception {
        return iPropertyHouseHoldInfoService.getMoveInHouseHoldCount(roomId, projectId);
    }

    /**
     * <desc>
     *      获取房间中正常状态住户的数量
     * <desc/>
     *
     * @param roomId 房间Id
     * @param  projectId  项目Id
     * @return 房间中正常状态住户的数量
     * @author zhangs
     * @createDate 2017/12/04
     */
    @RequestMapping(path = "/manage/getUserMoveInHouseHoldCount", method = RequestMethod.POST)
    @Override
    public Integer getUserMoveInHouseHoldCount(@RequestParam("roomId") String roomId, @RequestParam("projectId") String projectId, @RequestParam("userId") String userId) throws Exception {
        return iPropertyHouseHoldInfoService.getUserMoveInHouseHoldCount(roomId, projectId, userId);
    }

    /**
     * <desc>
     *      地址变更更新App端用户的设备权限
     * <desc/>
     *
     * @param userIds 二级用户Id
     * @param authUserId 一级用户Id
     * @param projectId 项目Id
     * @return
     * @author zhangs
     * @createDate 2017/10/20
     */
    @RequestMapping(path = "/manage/updateAppUserAuth", method = RequestMethod.POST)
    @Override
    public void updateAppUserAuth(
            @RequestBody List<String> userIds,
            @RequestParam("authUserId") String authUserId,
            @RequestParam("projectId") String projectId) throws Exception {
        iPropertyHouseHoldInfoService.updateAppUserAuth(userIds, authUserId, projectId);
    }

    /**
     * <desc>
     *      查询一卡通用户信息接口(一卡通用户+查询按钮)
     * <desc/>
     *
     * @param checkSmartCardUserDTO 查询App用户信息传输数据
     * @return Page<AppUserInfoGetVO> 用户房间信息分页集
     * @author zhangs
     * @createDate 2017/12/08
     */
    @RequestMapping(path = "/manage/getCheckSmartCardUserList", method = RequestMethod.POST)
    @Override
    public Page<AppUserInfoGetVO> getCheckSmartCardUserList(@RequestBody CheckSmartCardUserDTO checkSmartCardUserDTO) throws Exception {
        return iPropertyHouseHoldInfoService.getCheckSmartCardUserList(checkSmartCardUserDTO);
    }

    /**
     * <desc>
     *      修改一卡通用户信息
     * <desc/>
     *
     * @param  smartCardUserUpdateDTO 物业后台更新一卡通用户信息数据传输对象
     * @param  isSmartCommunity 是否开启云对讲
     * @return MessageVO 标准格式化响应结果
     * @author zhangs
     * @createDate 2017/12/08
     */
    @RequestMapping(path = "/manage/updateSmartCardUser", method = RequestMethod.POST)
    @Override
    public void updateSmartCardUser(
            @RequestBody SmartCardUserUpdateDTO smartCardUserUpdateDTO,
            @RequestParam("isSmartCommunity") Integer isSmartCommunity) throws Exception {
        iPropertyHouseHoldInfoService.updateSmartCardUser(smartCardUserUpdateDTO, isSmartCommunity);
    }

    /**
     * <desc>
     *      获取住户项目数据状态(status)正常下住户项目状态(userProjectStatus)
     * <desc/>
     *
     * @param  projectId 项目Id
     * @param  userId 用户Id
     * @return Integer
     * @author zhangs
     * @createDate 2017/12/21
     */
    @RequestMapping(path = "/manage/getUserProjectStatusAtNormal", method = RequestMethod.POST)
    @Override
    public Integer getUserProjectStatusAtNormal(
            @RequestParam("projectId") String projectId,
            @RequestParam("userId") String userId) throws Exception {
        return iPropertyHouseHoldInfoService.getUserProjectStatusAtNormal(projectId, userId);
    }

    /**
     * <desc>
     *      查询项目下的用户是否存在
     * <desc/>
     *
     * @param  projectId 项目Id
     * @param  userId 用户Id
     * @return Integer
     * @author Juguang.S
     * @createDate 2021/06/18
     */
    @Override
    @RequestMapping(path = "/manage/getUserIsExist", method = RequestMethod.POST)
    public Integer getUserIsExist(
            @RequestParam("projectId") String projectId,
            @RequestParam("userId") String userId) throws Exception{
        return iPropertyHouseHoldInfoService.getUserIsExist(projectId, userId);
    }

    /**
     * <desc>
     *      临时提供一个通过手机号码查询APP用户id接口
     * </desc>
     *
     * @param phoneNum
     * @return
     * @author wangzhi
     * @createDate 2018-04-18
     */
    @Override
    @PostMapping(path = "/manage/getAppUserIdTemporary")
    public String getAppUserIdTemporary(@RequestParam("phoneNum") String phoneNum) throws Exception {
        return iPropertyHouseHoldInfoService.getAppUserIdTemporary(phoneNum);
    }

    /**
     * <desc>
     *      更新人脸注册信息
     * <desc/>
     *
     * @param  appUserProjectPO 人脸注册信息
     * @return Integer
     * @author Qiang.S
     * @createDate 2018/05/18
     */
    @RequestMapping(path = "/manage/updatePreUserBaiduFaceInfo", method = RequestMethod.POST)
    @Override
    public Integer updatePreUserBaiduFaceInfo(@RequestBody AppUserProjectPO appUserProjectPO) throws Exception {
        return iPropertyHouseHoldInfoService.updatePreUserBaiduFaceInfo(appUserProjectPO);
    }

    /**
     * <desc>
     *     查询此身份证是否已被绑定
     * </desc>
     *
     * @param userId 用户编号
     * @param projectId 项目编号
     * @param idcardKey 身份证序号
     * @return
     * @author Qiang.S
     * @createDate 2018-08-22
     */
    @RequestMapping(path = "/manage/getIDCardByUserId", method = RequestMethod.POST)
    @Override
    public Integer getIDCardByUserId(@RequestParam("userId") String userId,
                                     @RequestParam("projectId") String projectId,
                                     @RequestParam("idcardKey") String idcardKey) throws Exception {
        return iPropertyHouseHoldInfoService.getIDCardByUserId(userId,projectId,idcardKey);
    }

    /**
     * <desc>
     *     绑定身份证
     * </desc>
     *
     * @param userId 用户编号
     * @param projectId 项目编号
     * @param idcardKey 身份证序号
     * @param idCard 身份证号
     * @param mark 绑定身份证推送指令是否需要延迟  更换身份证需要先推送解绑再推绑定
     * @return
     * @author Qiang.S
     * @createDate 2018-08-22
     */
    @RequestMapping(path = "/manage/bindingIDCard", method = RequestMethod.POST)
    @Override
    public Integer bindingIDCard(@RequestParam("userId") String userId,
                                 @RequestParam("projectId") String projectId,
                                 @RequestParam("idcardKey") String idcardKey,
                                 @RequestParam("idCard") String idCard,
                                 @RequestParam(value = "idCardStatus",required = false) String idCardStatus,
                                 @RequestParam("mark") boolean mark) throws Exception {
        return iPropertyHouseHoldInfoService.bindingIDCard(userId,projectId,idcardKey,idCard,idCardStatus,mark);
    }

    /**
     * <desc>
     *     解绑身份证
     * </desc>
     *
     * @param userId 用户编号
     * @param projectId 项目编号
     * @return
     * @author Qiang.S
     * @createDate 2018-08-22
     */
    @RequestMapping(path = "/manage/untieIDCard", method = RequestMethod.POST)
    @Override
    public Integer untieIDCard(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception {
        return iPropertyHouseHoldInfoService.untieIDCard(userId,projectId);
    }

    /**
     * <desc>
     *      临时授权推送平板用户信息
     * </desc>
     *
     * @param projectId
     * @param userId
     * @author Jiaqi.X
     * @createDate 2019/03/25
     */
    @PostMapping(path = "/manage/pushPadUserInfos")
    public void pushPadUserInfos(@RequestParam("projectId") String projectId,@RequestParam("userId") String userId,
                                 @RequestParam(value = "doorAuth",required = false)String doorAuth,
                                 @RequestParam(value = "elevatorAuth",required = false) String elevatorAuth,
                                 @RequestParam(value = "talkAuth",required = false) String talkAuth) throws Exception {
        iPropertyHouseHoldInfoService.pushPadUserInfos(projectId, userId,doorAuth,elevatorAuth,talkAuth);
    }

    /**
     * <desc>
     *      推送用户临时权限至设备
     * </desc>
     *
     * @param projectId
     * @param userId
     * @param type 为1只推送云电梯指令  为2则只推送云门禁指令 为3则推送云电梯和云门禁指令
     * @author Jiaqi.X
     * @createDate 2019/03/25
     */
    @PostMapping(path = "/manage/pushTempUserInfos")
    public void pushTempUserInfos(@RequestParam("projectId") String projectId,@RequestParam("userId") String userId,
                           @RequestParam(value = "doorAuth",required = false)String doorAuth,
                           @RequestParam(value = "elevatorAuth",required = false) String elevatorAuth,
                           @RequestParam(value = "talkAuth",required = false) String talkAuth,
                           @RequestParam(value = "type",required = false) String type) throws Exception{
        iPropertyHouseHoldInfoService.pushTempUserInfos(projectId, userId,doorAuth,elevatorAuth,talkAuth,type);
    }

    /**
     *     身份证挂失信息更新
     * </desc>
     *
     * @param userId 用户编号
     * @param projectId 项目编号
     * @param isLoss 挂失状态:0 正常,1 挂失
     * @return
     * @author Qiang.S
     * @createDate 2019-02-20
     */
    @RequestMapping(path = "/manage/updateIsLossInfo", method = RequestMethod.POST)
    @Override
    public Integer updateIsLossInfo(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId, @RequestParam("isLoss") String isLoss) throws Exception {
        return iPropertyHouseHoldInfoService.updateIsLossInfo(userId,projectId,isLoss);
    }

    /**
     * <desc>
     *      获取房间类型
     * <desc/>
     *
     * @param roomId 房间Id
     * @param  projectId  项目Id
     * @return 房间类型
     * @author Juguang.S
     * @createDate 2019/08/14
     */
    @Override
    @RequestMapping(path = "/manage/getHousesType", method = RequestMethod.POST)
    public Integer getHousesType(@RequestParam("roomId") String roomId, @RequestParam("projectId") String projectId) throws Exception{
        return iPropertyHouseHoldInfoService.getHousesType(roomId,projectId);
    }

    /**
     * <desc>
     *      修改用户信息
     * <desc/>
     *
     * @param dto
     * @return 房间类型
     * @author Qiang.S
     * @createDate 2019/11/05
     */
    @Override
    @RequestMapping(path = "/manage/updateUserInfo", method = RequestMethod.POST)
    public Integer updateUserInfo(@RequestBody CloudFaceApiDTO dto) throws Exception{
        return iPropertyHouseHoldInfoService.updateUserInfo(dto);
    }

    /**
     * <desc>
     *      查询用户列表
     * <desc/>
     *
     * @param dto
     * @return 用户信息
     * @author Qiang.S
     * @createDate 2019/11/06
     */
    @Override
    @RequestMapping(path = "/manage/getUserInfoForApi", method = RequestMethod.POST)
    public Page<SDKFaceUserInfoGetVO> getUserInfoForApi(@RequestBody CloudFaceApiDTO dto) throws Exception {
        return iPropertyHouseHoldInfoService.getUserInfoForApi(dto);
    }

    /**
     * <desc>
     *      获取旧用户临时权限信息
     * </desc>
     *
     * @param userId
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/09/25
     */
    @RequestMapping(path = "/manage/getOldUserTempAuth", method = RequestMethod.POST)
    public Map<String,Object> getOldUserTempAuth(@RequestParam("userId") String userId,@RequestParam("projectId") String projectId){
        return iPropertyHouseHoldInfoService.getOldUserTempAuth(userId,projectId);
    }

    /**
     * <desc>
     *      获取修改前的用户名称及标签
     * </desc>
     *
     * @param userId
     * @param projectId
     * @return
     * @author Juguang.S
     * @createDate 2020/05/20
     */
    @RequestMapping(path = "/manage/getOldUserInfo", method = RequestMethod.POST)
    public Map<String,Object> getOldUserInfo(@RequestParam("userId") String userId,@RequestParam("projectId") String projectId){
        return iPropertyHouseHoldInfoService.getOldUserInfo(userId,projectId);
    }

    /**
     * <desc>
     * 根据用户id查询用户房间信息用于平板增量数据推送
     * </desc>
     *
     * @param userIds
     * @param projectId
     * @return
     * @author jiaqi.X
     * @createDate 2019/03/20
     */
    @Override
    @RequestMapping(path = "/manage/getUserRoomIdsByUserIdAndProjectId", method = RequestMethod.POST)
    public List<Map<String, Object>> getUserRoomIdsByUserIdAndProjectId(@RequestParam("userIds") String[] userIds,@RequestParam("projectId") String projectId) {
        return iPropertyHouseHoldInfoService.getUserRoomIdsByUserIdAndProjectId(userIds, projectId);
    }
    /**
     * <desc>
     *     人脸注册-业主
     * </desc>
     *
     * @param params
     * @return
     * @author pengwei
     * @createDate 2020/12/08
     */
    @RequestMapping(path = "manage/jdUserFaceReg", method = RequestMethod.POST)
    public String jdUserFaceReg(@RequestBody JSONObject params)throws Exception{
        return iPropertyHouseHoldInfoService.jdUserFaceReg(params);
    }

    /**
     * <desc>
     *     京东非标-人脸注册-业主物理删除
     * </desc>
     *
     * @param params
     * @return
     * @author pengwei
     * @createDate 2020/12/16
     */
    @RequestMapping(path = "manage/jdUserRealDel", method = RequestMethod.POST)
    public  void jdUserRealDel(@RequestBody JSONObject params)throws Exception{
        iPropertyHouseHoldInfoService.jdUserRealDel(params);
    }



    /**
     * <desc>
     *     人脸注册-访客
     * </desc>
     *
     * @param params
     * @return
     * @author pengwei
     * @createDate 2020/12/09
     */
    @RequestMapping(path = "manage/jdVisitorFaceReg", method = RequestMethod.POST)
    public String jdVisitorFaceReg(@RequestBody JSONObject params)throws Exception{
        return iPropertyHouseHoldInfoService.jdVisitorFaceReg(params);
    }

    /**
     * <desc>
     *     京东非标-用户修改
     * </desc>
     *
     * @param params
     * @return
     * @author pengwei
     * @createDate 2020/12/10
     */
    @RequestMapping(path = "manage/jdUserUpdate", method = RequestMethod.POST)
    public  JDResultVO   jdUserUpdate(@RequestBody JSONObject params)throws Exception{
        return iPropertyHouseHoldInfoService.jdUserUpdate(params);
    }

    /**
     * <desc>
     *     京东非标-用户逻辑删除
     * </desc>
     *
     * @param params
     * @return
     * @author pengwei
     * @createDate 2020/12/10
     */
    @RequestMapping(path = "manage/jdUserDelete", method = RequestMethod.POST)
    public  JDResultVO   jdUserDelete(@RequestBody JSONObject params)throws Exception{
        return iPropertyHouseHoldInfoService.jdUserDelete(params);
    }


    /**
     * <desc>
     *     京东非标-访客内部更新，不做对外接口
     * </desc>
     *
     * @param params
     * @return
     * @author pengwei
     * @createDate 2020/12/09
     */
    @RequestMapping(path = "manage/jdVisitorUpdate", method = RequestMethod.POST)
    public Integer jdVisitorUpdate(@RequestBody JSONObject params)throws Exception{
        return iPropertyHouseHoldInfoService.jdVisitorUpdate(params);
    }


    /**
     * <desc>
     *     京东非标-乘梯权限变更
     * </desc>
     *
     * @param params
     * @return
     * @author pengwei
     * @createDate 2020/12/10
     */
    @RequestMapping(path = "manage/jdAuthAlter", method = RequestMethod.POST)
    public  JDResultVO  jdAuthAlter(@RequestBody JSONObject params)throws Exception{
        return iPropertyHouseHoldInfoService.jdAuthAlter(params);
    }

    /**
     * <desc>
     *     京东非标-电梯及楼层信息获取
     * </desc>
     *
     * @param params
     * @return
     * @author pengwei
     * @createDate 2020/12/11
     */
    @RequestMapping(path = "manage/getAllElevatorInfo", method = RequestMethod.POST)
    public   JDResultVO getAllElevatorInfo(@RequestBody JSONObject params)throws Exception{
        return   iPropertyHouseHoldInfoService.getAllElevatorInfo(params);
    }

    /**
     * <desc>
     *      获取人员类型id
     * </desc>
     *
     * @param userTypeName 人员类型名称
     * @param projectId 项目id
     * @return 人员类型id
     * @Author Zhu.yj
     * @createDate  2021/4/9
     */
    @Override
    @RequestMapping("/user/manage/getUserTypeIdByName")
    public Integer getUserTypeIdByName(@RequestParam("userTypeName") String userTypeName, @RequestParam("projectId") String projectId) throws Exception {
        return iPropertyHouseHoldInfoService.getUserTypeIdByName(userTypeName, projectId);
    }
    /**
     * <desc>
     *      获取用户有关人脸和身份证相关信息
     * </desc>
     *
     * @param userId 用户id
     * @param projectId 项目id
     * @return
     * @Author Juguang.S
     * @createDate  2021/4/20
     */
    @Override
    @RequestMapping("/user/manage/getUserFaceAndIdCardInfo")
    public PropertyUserProofAuthInfoGetVO getUserFaceAndIdCardInfo(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception {
        return iPropertyHouseHoldInfoService.getUserFaceAndIdCardInfo(userId, projectId);
    }
    /**
     * <desc></desc>
     *      根据房间id获取房间号
     * </desc>
     *
     * @param roomId 房间id
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/20
     */
    @Override
    @RequestMapping("/property/household/getRoomNum")
    public String getRoomNum(@RequestParam("roomId") String roomId) throws Exception {
        return iPropertyHouseHoldInfoService.getRoomNum(roomId);
    }

    /**
     * <desc>
     *      删除审核未通过的用户
     * </desc>
     *
     * @param userRemoveDTOS 删除用户房间参数
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/28
     */
    @Override
    @PostMapping("/property/setting/user/removeUnPassedUser")
    public Integer removeUnPassedUser(@RequestBody List<AppUnCheckUserRemoveDTO> userRemoveDTOS,@RequestParam("projectId") String projectId) throws Exception {
        return iPropertyHouseHoldInfoService.removeUnPassedUser(userRemoveDTOS, projectId);
    }

    /**
     * <desc>
     *      获取用户列表时的附加字段
     * </desc>
     *
     * @param
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/29
     */
    @Override
    @PostMapping("/property/setting/user/getAppendInfo")
    public Map<String, Object> getAppendInfo(@RequestBody CheckAppUserDTO checkAppUserDTO) throws Exception {
        return iPropertyHouseHoldInfoService.getAppendInfo(checkAppUserDTO);
    }

    /**
     * <desc>
     *      获取用户旧的角色组id（分组id）
     * </desc>
     *
     * @param userId
     * @param projectId
     * @return
     * @Author Zhu.yj
     * @createDate  2021/5/16
     */
    @PostMapping("/property/setting/user/getOldRoleGroupId")
    @Override
    public List<String> getOldRoleGroupId(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception {
        return iPropertyHouseHoldInfoService.getOldRoleGroupId(userId, projectId);
    }

    /**
     * <desc>
     *      根据用房和项目编号查询是否注册了人脸
     * </desc>
     *
     * @param userId
     * @param projectId
     * @return
     * @Author Juguang.S
     * @createDate  2021/06/11
     */
    @Override
    @PostMapping("/property/setting/user/isFaceUrlByUserIdAndProjectId")
    public Integer isFaceUrlByUserIdAndProjectId (@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception{
        return iPropertyHouseHoldInfoService.isFaceUrlByUserIdAndProjectId(userId, projectId);
    }

    /**
     * <desc>
     *      获取楼栋、单元及房间相关ID
     * <desc/>
     *
     * @param  roomDTO 项目Id
     * @return 楼栋、单元及房间相关ID
     * @Author Juguang.S
     * @createDate 2021/06/15
     */
    @Override
    @RequestMapping(path = "/manage/getRoomInfo", method = RequestMethod.POST)
    public AppUserRoomDTO getRoomInfo(@RequestBody AppUserRoomDTO roomDTO) throws Exception{
        return iPropertyHouseHoldInfoService.getRoomInfo(roomDTO);
    }

}
